import socket

# 创建一个UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

# 服务器地址
server_address = ('localhost', 10000)

# 发送消息
message = b'Hello, World!'
print('发送消息: {}'.format(message))
sock.sendto(message, server_address)

# 关闭socket
sock.close()